package order.controller;

import order.mapper.OrderMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import product.api.ProductApi;
import product.model.OrderInfo;

@RestController
@RequestMapping("feign")
public class FeignController {
    @Autowired
    ProductApi productApi;
    @Autowired
    OrderMapper orderMapper;

    @RequestMapping("/p1")
    public String p1() {
        productApi.o1(1L, "hhh");
        return "ok";
    }

    @RequestMapping("/p2")
    public String p2() {
        OrderInfo orderInfo = orderMapper.selectById(1);
        productApi.o2(orderInfo);
        return "ok";
    }

    @RequestMapping("/p3")
    public String p3() {
        OrderInfo orderInfo = orderMapper.selectById(2);
        productApi.o3(orderInfo);
        return "ok";
    }
}
